import request from '@/utils/request'
import {HospitalDetail,DepartmentResponseData,HospitalWorkData,DoctorResponseDta,UserResponseData,DoctorInfoData} from './type'
import {LocationQueryValue} from "vue-router";
enum API{
    // 医院详情的url
    HOSPITAL_DETAIL_URL ='/api/hosp/hospital/',
    //获取科室列表的URL
    HOSPITAL_DEPARTMENT='/api/hosp/hospital/department/',
    //获取某一个医院的某一个科室预约挂号数据
    HOSPITALWORK_URL='/api/hosp/hospital/auth/getBookingScheduleRule/',
    //获取医院某一个科室某一天响应医生排班的数据
    HOSPITALDOCTOR_URI='/api/hosp/hospital/auth/findScheduleList/',
    //获取所有就诊人信息
    GETUSER_URL='/api/user/patient/auth/findAll',
    //获取挂号信息
    GETDOCTOR_URL='/api/hosp/hospital/getSchedule/'
}
// 获取医院详情的方法
export const reqHospitalDetail =(hoscode:string)=>{
    return request.get<any,HospitalDetail>(API.HOSPITAL_DETAIL_URL+hoscode)
}
// 获取医院科室的请求的方法
export const  reqHospitalDepartment =(hoscode:string)=>{
    return request.get<any,DepartmentResponseData>(API.HOSPITAL_DEPARTMENT+hoscode)
}
//获取医院挂号状态
export const reqHospitalWork =(page:number,limit:number,hoscode:string,depcode:string)=>{
    return request.get<any,HospitalWorkData>(API.HOSPITALWORK_URL+`${page}/${limit}/${hoscode}/${depcode}`)
}
//获取可以挂号的科室的医生信息
export const reqHospitalDoctor = (hoscode: string | null | LocationQueryValue[], depcode: string | null | LocationQueryValue[], workDate: string)=>{
    return request.get<any,DoctorResponseDta>(API.HOSPITALDOCTOR_URI+`${hoscode}/${depcode}/${workDate}`)
}
//获取所有就诊人信息
export const reqGetAllUser =()=>{
    return request.get<any,UserResponseData>(API.GETUSER_URL)
}
//获取挂号医生的信息
export const reqDocorInfo =(scheduleId:string)=>{
    return request.get<any,DoctorInfoData>(API.GETDOCTOR_URL+`${scheduleId}`)
}
